pseudo-class :last-child, :first-child


Posted by mijouhsieh on 2023-04-16

//在 .card 內部裡的最後一個 p 元素
.card p:last-child {  
    transform: rotate(180deg);
 }
.complete > p:first-child {
  font-size: 3em;
  font-weight: 700;
  color: #758d9a;
}

選擇器中的冒號(:)是 CSS 的 pseudo-class,:last-child 指的是在同一個階層的同類元素中,選出最後面的元素。



#pseudo-class #:first-child #:last-child







Related Posts

ASP.NET Core Web API 入門教學 - DbContext取得資料庫資料時注意事項

ASP.NET Core Web API 入門教學 - DbContext取得資料庫資料時注意事項

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段二:專題研討+協作練習專案)

AppWorks School Batch #16 Front-End Class 學習筆記&心得(駐點階段二:專題研討+協作練習專案)

Whack A Mole Game

Whack A Mole Game


Comments